package javanlp;

import java.io.*;
import opennlp.tools.cmdline.parser.*;
import opennlp.tools.parser.*;
import opennlp.tools.util.*;

public class stParser{
public static void main(String[] args) 
        throws InvalidFormatException, IOException {
    String fld = "C:/Users/lenovolap/Dropbox/java/NLP.models/";
    String trainedmodel = fld+"en-parser-chunking.zip";
    try (InputStream is = new FileInputStream(trainedmodel)) {
        ParserModel model = new ParserModel(is);
        Parser parser = ParserFactory.create(model);
        String sentence = "Programcreek is a very huge and useful website.";
        Parse topParses[] = ParserTool.parseLine(sentence, parser, 1);
        for (Parse p : topParses) { p.show();}
       }
}
}